import request from '@/utils/request'
const base_chapter_API = '/eduservice/chapter'

export default {

  // 获取课程大纲列表，根据课程id进行查询
  getChapterVideo(courseId){
    return request({
      url: `${base_chapter_API}/getChapterVideo/${courseId}`,
      method: 'get'
    })
  },

  // 根据章节id查询章节
  getChapterInfoById(chapterId){
    return request({
      url: `${base_chapter_API}/getChapterInfoById/${chapterId}`,
      method: 'get'
    })
  },

  // 添加章节
  addChapter(EduChapter){
    return request({
      url: `${base_chapter_API}/addChapter`,
      method: 'post',
      data: EduChapter
    })
  },

  // 修改章节
  updateChapter(EduChapter){
    return request({
      url: `${base_chapter_API}/updateChapter`,
      method: 'post',
      data: EduChapter
    })
  },

  // 删除章节
  deleteChapter(chapterId){
    return request({
      url: `${base_chapter_API}/deleteChapter/${chapterId}`,
      method: 'delete'
    })
  }
}
